package com.ruoyi.project.datamanage.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.datamanage.domain.DrugStatistics;
import com.ruoyi.project.datamanage.service.DrugService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/datamanage/drug")
public class DrugController extends BaseController {
    @Autowired
    private  DrugService drugservice;

    @PreAuthorize("@ss.hasPermi('datamanage:drug:list')")
    @GetMapping("/list")
    public TableDataInfo drugsell(DrugStatistics drugStatistics){

        startPage();

        List<DrugStatistics> list =drugservice.selectDrug(drugStatistics);

        return getDataTable(list);

    }

    @PreAuthorize("@ss.hasPermi('datamanage:drug:list2')")
    @GetMapping("/list2")
    public TableDataInfo drugsell2(DrugStatistics drugStatistics){

        startPage();

        List<DrugStatistics> list =drugservice.selectDrugsell(drugStatistics);

        return getDataTable(list);

    }
}
